package com.kuizii.base.api;


public class CustomException extends RuntimeException {

    public <T> CustomException(String msg, String detailMsg, int httpStatus, T data, Throwable cause) {
        super(msg, cause);
        this.message = msg;
        this.detailMsg = detailMsg;
        this.httpStatus = httpStatus;
        this.data=data;
    }

    public CustomException(String msg, String detailMsg, int httpStatus, Throwable cause) {
        super(msg, cause);
        this.message = msg;
        this.detailMsg = detailMsg;
        this.httpStatus = httpStatus;
    }

    public CustomException(String msg, String detailMsg, Throwable cause) {

        this(msg, null, 500, cause);
    }

    public CustomException(String msg, int httpStatus) {
        this(msg, null, httpStatus,null);
    }

    public CustomException(String msg, int httpStatus, Throwable cause) {
        this(msg, null, httpStatus, cause);
    }

    public CustomException(String message, Throwable cause) {
        this(message, null, 500, cause);
    }

    public CustomException(String msg) {
        this(msg, null, 500, null);
    }
    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    private String message;

    public String getDetailMsg() {
        return detailMsg;
    }

    public void setDetailMsg(String detailMsg) {
        this.detailMsg = detailMsg;
    }

    private String detailMsg;

    public int getHttpStatus() {
        return httpStatus;
    }

    public void setHttpStatus(int httpStatus) {
        this.httpStatus = httpStatus;
    }

    private int httpStatus = 500;

    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    private Integer errorCode;

    @Override
    public Throwable getCause() {
        return cause;
    }

    public void setCause(Throwable cause) {
        this.cause = cause;
    }

    private Throwable cause;

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    Object data;
}
